<!-- 扫码加入学习组成功页面 -->

<template>
	<focus-body mode="auto">
		
		<!-- 顶部间隔 -->
		<focus-box width="100" height="100"></focus-box>
		
		<!-- 内容区域 -->
		<focus-box width="750" mode="col" justify="start" align="center">
			
			<!-- 白底圆角容器 -->
			<focus-box width="702" :padding="[70,0]" mode="col" justify="start" align="center"
			bg="white" radius="12">
				<!-- 成功图标 -->
				<image style="width:80rpx; height:80rpx; margin-bottom:30rpx;" src="@/pagesB/static/img/collective/right.png"></image>
				<!-- 成功文字 -->
				<focus-text size="32" color="content" weight="bold" text="加入成功"></focus-text>
				<!-- 中间间隔 -->
				<focus-box width="100" height="65"></focus-box>
				
				<!-- 所在项目文字cell行容器 -->
				<focus-box width="702" :margin="[15,0]" mode="row" justify="center" align="start">
					<!-- 左边类目名称 -->
					<focus-box width="190" mode="row" justify="start">
						<focus-text size="30" color="info" text="所在项目"></focus-text>
					</focus-box>
					<!-- 右边文字 -->
					<focus-box width="450" mode="row" justify="start">
						<focus-text size="30" color="content" :text="shortData.project"></focus-text>
					</focus-box>
				</focus-box>
				
				<!-- 工作单位文字cell行容器 -->
				<focus-box width="702" :margin="[15,0]" mode="row" justify="center" align="start">
					<!-- 左边类目名称 -->
					<focus-box width="190" mode="row" justify="start">
						<focus-text size="30" color="info" text="工作单位"></focus-text>
					</focus-box>
					<!-- 右边文字 -->
					<focus-box width="450" mode="row" justify="start">
						<focus-text size="30" color="content" :text="shortData.company"></focus-text>
					</focus-box>
				</focus-box>
				
				<!-- 创建时间文字cell行容器 -->
				<focus-box width="702" :margin="[15,0]" mode="row" justify="center" align="start">
					<!-- 左边类目名称 -->
					<focus-box width="190" mode="row" justify="start">
						<focus-text size="30" color="info" text="创建时间"></focus-text>
					</focus-box>
					<!-- 右边文字 -->
					<focus-box width="450" mode="row" justify="start">
						<focus-text size="30" color="content" :text="shortData.time"></focus-text>
					</focus-box>
				</focus-box>
				
				<!-- 已加入人员文字cell行容器 -->
				<focus-box width="702" :margin="[15,0]" mode="row" justify="center" align="start">
					<!-- 左边类目名称 -->
					<focus-box width="190" mode="row" justify="start">
						<focus-text size="30" color="info" text="已加入人员"></focus-text>
					</focus-box>
					<!-- 右边文字 -->
					<focus-box width="450" mode="row" justify="start">
						<focus-text size="30" color="content" :text="shortData.people"></focus-text>
					</focus-box>
				</focus-box>
				
			</focus-box>
			
			<!-- 按钮间隔 -->
			<focus-box width="100" height="40"></focus-box>
			
			<!-- 确定按钮 -->
			<focus-box width="686" height="80" mode="row" justify="center" align="center"
			bg="primary" bgscheme="hover" radius="40" @click="studyStartClick">
				<focus-text size="32" color="white" text="开始学习"></focus-text>
			</focus-box>
			
		</focus-box>
		
	</focus-body>
</template>

<script>
	export default {
		
		// 页面数据
		data() {
			return {
				// 临时缓存
				shortData: {
					groupId: 0, // 学习组id
					project: "", // 所在项目
					company: "", // 工作单位
					time: "", // 创建时间
					people: "", // 已加入人员
				},
			}
		},
		
		// 页面载入完成
		onLoad() {
			// 读取临时缓存
			var save_short = uni.$focus.varShortTime('get');
			// 如果数据有效
			if (save_short && save_short.pages_tabbar_collective_joinGroup_reqData)
			{
				// 临时缓存赋值
				this.shortData = save_short.pages_tabbar_collective_joinGroup_reqData;
			}
			// 错误提示
			else {
				uni.showToast({
					title: '数据有误',
					icon: 'none',
					duration: 2500,
				});
			}
		},
		
		onShow() {
			this.getImageUrl()
		},
		// 分享到聊天
		onShareAppMessage() {},
		
		// 页面事件
		methods: {
			
			// 开始学习按钮 点击
			studyStartClick() {
				// 跳转到学习组详情页
				uni.$focus.pageJump('/pages/learning/details/index', {
					groupId: this.shortData.groupId, // 学习组id
				}, 'replace');
			},
			getImageUrl() {
				request.groupDetails({
					urlData: {
						id: this.send.groupId, // 学习组id
					},
					success: (res) => {
						// uni.hideLoading()
					},
				});
			},
			
		},
		
	}
</script>